Skip to content

Conversation

ivancmz
Copy link

@ivancmz ivancmz commented Jul 16, 2025

This PR adds a C# API wrapper for PanelPlayer, enabling .NET applications to control Colorlight LED panels programmatically.

Key Features Added

  • C API Library: New panelplayer_api.c/.h providing a stable C interface
  • Shared Library Support: Updated makefile to build libpanelplayer.so
  • C# P/Invoke Wrapper: Full .NET bindings with proper error handling and resource management
  • Complete Example Application: Demonstrates WebP playback and manual frame display
  • Comprehensive Documentation: Doxygen comments for all API functions

Changes Made

  • Added C API layer (source/panelplayer_api.c/.h) with functions for initialization, WebP playback, frame
    display, and extension loading
  • Updated makefile to build both executable and shared library targets
  • Created C# wrapper class with proper IDisposable pattern and exception handling
  • Added working C# example
  • Included detailed README with build instructions and troubleshooting
  • Added .gitignore entries for C# build artifacts

Testing

  • Tested on Orange Pi Zero 3 with Debian Bookworm and .NET 9.0
  • Verified WebP file playback and manual frame rendering
  • Confirmed proper resource cleanup and error handling

This enables PanelPlayer integration into .NET applications while maintaining the existing C application
functionality.

  - Create panelplayer_api.c/.h with C library interface
  - Add C# wrapper class with P/Invoke bindings
  - Include example C# application demonstrating usage
  - Update makefile to build shared library
  - Add gitignore entries for C# build artifacts
  - Add doxygen style comments to panelplayer_api header file
  - Add README.md to the csharp example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant